import multiprocessing, time


def test1(num):
    while True:
        print("1num------------", num)
        time.sleep(1)


def test2(num):
    while True:
        print("2num------------", num)
        time.sleep(1)


def main():
    p1 = multiprocessing.Process(target=test1, args=(1,))  # test1为调用函数名，args为要传递的参数
    p2 = multiprocessing.Process(target=test2, args=(2,))
    p1.start()  # 启动进程
    p2.start()


if __name__ == "__main__":
    main()
